/*
 * JHeuristics - The Java Meta-Heuritics Library
 * Copyright (C) 2004-2005, Universidade Federal de Campina Grande. All rights reserved.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package org.jheuristics.ga;

import java.io.Serializable;

/**
 * TODO
 *
 * @author Marcell Manfrin, marcell@ourgrid.org, Jan 9, 2006
 */
public class DefaultGAStatus implements GAStatus, Serializable {
	private Population current, avaliable, temp, selected;
	private int age;

	/**
	 * TODO
	 *
	 * @param age
	 * @param current
	 * @param avaliable
	 * @param selected
	 * @throws IllegalArgumentException
	 * @throws NullPointerException
	 */
	public DefaultGAStatus(int age, Population current, Population avaliable, Population temp, Population selected) {
		if (0 > age) {
			// TODO: ERROR MSG
			throw new IllegalArgumentException();
		}
		if (null == current) {
			// TODO: ERROR MSG
		    throw new NullPointerException();
		}
		if (null == avaliable) {
			// TODO: ERROR MSG
		    throw new NullPointerException();
		}
		if (null == temp) {
			// TODO: ERROR MSG
		    throw new NullPointerException();
		}
		if (null == selected) {
			// TODO: ERROR MSG
		    throw new NullPointerException();
		}
	    this.age = age;
		this.current = current;
		this.avaliable = avaliable;
		this.temp = temp;
		this.selected = selected;
	}

	/* (non-Javadoc)
	 * @see org.jheuristics.ga.GAStatus#getCurrentPopulation()
	 */
	public Population getCurrentPopulation() {
		return current;
	}

	/* (non-Javadoc)
	 * @see org.jheuristics.ga.GAStatus#getEvolutionAge()
	 */
	public int getEvolutionAge() {
		return age;
	}

	/* (non-Javadoc)
	 * @see org.jheuristics.ga.GAStatus#getAvaliableIndividualsPopulation()
	 */
	public Population getAvaliableIndividualsPopulation() {
		return avaliable;
	}

	/* (non-Javadoc)
	 * @see org.jheuristics.ga.GAStatus#getSelectedIndividualsPopulation()
	 */
	public Population getSelectedIndividualsPopulation() {
		return selected;
	}

	/**
	 * TODO
	 *
	 * @return
	 * @see org.jheuristics.ga.GAStatus#getTempIndividualsPopulation()
	 */
	public Population getTempIndividualsPopulation() {
		return temp;
	}

}
